package com.interauto.Dao.Mapper;

import com.interauto.Dao.entity.Interunt;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 管理接口运行结果的表
 */
@Mapper
public interface MgInteruntInter {

    @Insert("insert into interunt(caseruntid, interfacename, status, message, intercasetype, autoassinfo, " +
            "httpurl, httpheader, httpcookie, postparamtype, httpparam, rescode, resheader, rescookie, " +
            "restype, resinfo, httpmeth,createtime) " +
            "value (#{param.caseruntid},#{param.interfacename},#{param.status},#{param.message},#{param.intercasetype}," +
            "#{param.autoassinfo},#{param.httpurl},#{param.httpheader},#{param.httpcookie},#{param.postparamtype}," +
            "#{param.httpparam},#{param.rescode},#{param.resheader},#{param.rescookie},#{param.restype},#{param.resinfo},#{param.httpmeth},now())")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void addinterrunt(@Param(value = "param") Interunt interunt);


    @Select("select * from interunt where caseruntid=#{caseruntid}")
    List<Interunt> getInterunt(@Param(value = "caseruntid") int caseruntid);


    @Select("select * from interunt where id=#{id}")
    Interunt getInteruntforid(int id);
}
